package com.example.train_operate.service.impl;

import com.example.train_operate.service.FileService;
import com.example.train_operate.util.LocalUpload;
import com.example.train_operate.util.OssUpload;
import com.example.train_operate.util.Result;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class FileServiceImpl implements FileService {

    /**
     * 图片上传至阿里云
     * @param file
     * @return
     */
    @Override
    public Result uploadFileToOss(MultipartFile file) {
        return OssUpload.uploadFile(file);
    }

    /**
     * 图片上传至本地
     * @param file
     * @return
     */
    @Override
    public Result uploadFileToLocal(MultipartFile file) {
        return LocalUpload.uploadFileToLocal(file);
    }
}
